* SETFOCUS

LPARAMETERS WFORMULARIO,WCAMPO,WALIAS

*TABELA.CAMPO
WCONTROLE=WALIAS+"."+WCAMPO
NTAM=AMEMBER(OBJS,WFORMULARIO,2)

* LOCALIZA OBJ DO CAMPO
   FOR I=1 TO NTAM
       RCONTROLE="WFORMULARIO."+OBJS(I)+".CONTROLSOURCE"
       * EXISTE CONTROL SORCE PARA ESTE OBJETO ?
       IF TYPE(RCONTROLE)="C"  && SE EXISTIR
          MESSAGEBOX(&RCONTROLE+CHR(13)+WCONTROLE)
          IF UPPER(&RCONTROLE) = UPPER(WCONTROLE)
             * ENVIA FOCO
               FOCUS="WFORMULARIO."+OBJS(I)+".SETFOCUS"
               MESSAGEBOX(FOCUS)
               &FOCUS
               EXIT
          ENDIF
       ENDIF
    ENDFOR   
            